#include <iostream>
#include <string>

#include <jsoncpp/json/json.h>

int main()
{
    Json::Value root;

    root["code"] = "code";
    root["user"] = "qingdiaoshen";
    root["age"] = 20;

    Json::StyledWriter writer;
    std::string str = writer.write(root);

    std::cout << str << std::endl;

    return 0;
}
